home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-06-24 | 2.8 KB | 120 lines | [F+PR/FOXX] |
-
- *:main
- DO Initialization
- DO FaxSetup
- DO ProcessRecords
- DO FaxCleanUp
- DO HouseCleaning
- *:end main
-
- *:*********************************************************************
- PROCEDURE Initialization
-
- *: --- Initialize gloabal variables --- :*
- PUBLIC TRUE, FALSE, OrigionalHeader, anError, OldPrinter
- TRUE = "1"
- FALSE = "0"
- OrigionalHeader = TRUE
- anError = FALSE
- NewPrinter = "FaxPrint"
-
- *: --- Setup the environment for speed gain --- :*
- SET TALK OFF
- SET DOHISTORY OFF
- SET OPTIMIZE ON
-
- *: --- Prepare the necessary files --- :*
- SET EXCLUSIVE ON
- USE "FaxDemo.dbf"
- SET XCMDFILE TO "FoxPro Externals"
-
- *: --- Load the necessary HyperCard XCMD resources --- :*
- LOAD "STFStartup"
- LOAD "STFAddDestinations"
- LOAD "STFShutDown"
- LOAD "STFdoSwitchPrinter"
- LOAD "STFdoSwitchToFaxPrint"
- LOAD "STFdoRestorePrinter"
- LOAD "STFdoScanSpoolFolder"
- LOAD "STFdoGetSoftwareState"
- LOAD "STFIsFaxSTFInstalled"
- LOAD "STFgetSTFDriverStatus"
-
- RETURN
-
- *:*********************************************************************
- PROCEDURE FaxSetup
-
- *: --- Set the device to "FaxPrint" --- :*
- CALL "STFdoSwitchToFaxPrint" TO OldPrinter
-
- *: --- CRITICAL: Turn off header/(page eject) --- :*
- SET HEADING OFF
-
- RETURN
-
- *:*********************************************************************
- PROCEDURE ProcessRecords
-
- *: --- Goto the top of the .dbf file and read all records --- :*
- GOTO TOP
- LOCATE ALL
- DO WHILE !EOF()
-
- *: --- Dump the record into an array --- :*
- SCATTER TO fieldArray
- coName = fieldArray[1]
- faxNum = fieldArray[2]
- voiceNum = fieldArray[3]
- title = fieldArray[4]
- sal = fieldArray[5]
- firstName = fieldarray[6]
- lastName = fieldArray[7]
- note = fieldArray[8]
- autoDelete = fieldArray[9]
- delay = fieldArray[10]
- coverPg = fieldArray[11]
- callGroup = fieldArray[12]
- faxArchive = fieldArray[13]
- wholeName = (ALLTRIM(firstName) + ' ' + ALLTRIM(lastName))
-
-
- *: --- Create the 'destinations' file --- :*
- CALL "STFStartup" WITH note,delay,autoDelete,callGroup,coverPg,TRIM(faxArchive) TO anError
-
- *: --- If a 'destinations' file was created....send the fax --- :*
- IF (anError = FALSE)
- CALL "STFAddDestinations" WITH TRIM(coName),faxNum,voiceNum,TRIM(firstName),TRIM(lastName),TRIM(sal)
- TYPE "FaxDemo.txt" TO PRINTER
- CALL "STFShutDown"
- ENDIF
-
- *: --- Read the next record --- :*
- CONTINUE
- ENDDO
-
- RETURN
-
- *:*********************************************************************
- PROCEDURE FaxCleanUp
-
-
- *: --- Set the printer back to the origional device --- :*
- CALL "STFdoRestorePrinter" TO anError
-
- RETURN
-
- *:*********************************************************************
- PROCEDURE HouseCleaning
-
- *: --- Reset the file handling conditions --- :*
- SET EXCLUSIVE OFF
-
- *: --- Clear the memory --- :*
- RELEASE ALL
-
- *:+ whatever else you need to do…
-
- RETURN
-
-